package org.projecteboot.compent.core.utils;

import java.util.Random;

/**
 * @author LuoQiang
 * @date 2019/8/29 16:39
 **/
public class NumRandomUtil {
    public static long random(long start, long end) {
        Double v = new Random(System.currentTimeMillis()).nextDouble();
        v = v * (end - start);
        return v.longValue() + start;
    }

    public static void main(String[] args) throws InterruptedException {
        for (int i = 0; i < 100; i++) {
            System.out.println(random(2, 5));
            Thread.sleep(1000);
        }

    }
}
